namespace GroupProject.Data.Migrations
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;
    using GroupProject.Data.Model;

    internal sealed class Configuration : DbMigrationsConfiguration<GroupProject.Data.ApplicationDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }

        protected override void Seed(GroupProject.Data.ApplicationDbContext context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //
            context.Students.AddOrUpdate(
                s => s.Id,
                new Student { Id= 1, FirstName = "Jane", LasName = "Doe", EmailAddress = "jane@groupproject.com" },
                new Student { Id = 2, FirstName = "John", LasName = "Doe", EmailAddress = "john@groupproject.com" },
                new Student { Id = 3, FirstName = "Mike", LasName = "Smith", EmailAddress = "mike@groupproject.com" },
                new Student { Id = 4, FirstName = "Mary", LasName = "Smith", EmailAddress = "mary@groupproject.com" }
                );

            context.Courses.AddOrUpdate(
                c => c.Id,
                new Course { Id=1, CourseName = "Computer Science", CourseNumber=101},
                new Course { Id=2, CourseName = "English", CourseNumber=202},
                new Course { Id=3, CourseName = "College Algebra", CourseNumber=301},
                new Course { Id=4, CourseName = "Business Management", CourseNumber=400}
                );            
        }

        
    }
}
